<%= stylesheet('bootstrap','style','group')%>
<div id="main">
	<div  class="container">
		<div class="notice-list">
			<div class="notice-num">通知提醒 <cite>(<%= @notifications.size %>条)</cite></div>
			<div class="notice-content cc">
				<ul>
					<% @notifications.each do |notification| %>
					<li class="cc">
						
						<div class="avatar">
							<% if notification.mention_id == nil %>
								<% if notification.notificationable.user.icon.exists? %>
									<%= image_tag notification.notificationable.user.icon.url(:thumb) ,:alt => notification.notificationable.user.nickname%>
								<% else %>
									<%= image_tag 'avatar.jpg' ,:alt => notification.notificationable.user.nickname %>
								<% end %>
							<% else %>
								<% if notification.notificationable.user.icon.exists? %>
									<%= image_tag notification.notificationable.user.icon.url(:thumb) ,:alt => notification.notificationable.user.nickname %>
								<% else %>
									<%= image_tag 'avatar.jpg' ,:alt => notification.user.nickname %>
								<% end %>
							<% end %>
						</div>
						<div class="notice-info">
							<% if notification.mention_id == nil %>
								<%= notification.notificationable.user.nickname %> 评论了您的话题：
										<%= link_to notification.notificationable.commentable.title, "/notifications/read/#{notification.id}/0" %>
										<%= format_content( truncate notification.notificationable.content, length: 100 ) %> <br/>
										<p><%= timeago_tag notification.created_at, :nojs => true, :limit => 10.days.ago %>
							<% else %>
								<%= link_to notification.notificationable.user.nickname,  notification.notificationable.user %> 在 
										<%= link_to notification.notificationable.commentable.title, "/notifications/read/#{notification.id}/0" %> 提及了您:
										<%= format_content( truncate notification.notificationable.content, length: 100 ) %> <br/>
										<p><%= timeago_tag notification.created_at, :nojs => true, :limit => 10.days.ago %>
							<% end %>

							<% if notification.is_read == false %>
							<span class="new-icon">(新) </span>
							<%end%>
							</p>
						</div>
						<div class="notice-status">
							

							<% if notification.is_read == false %>
											<%= link_to '已读', "/notifications/read/#{notification.id}/1" ,:class => 'btn btn-primary'%>
										<% end %>
										<%= link_to '删除', [@user, notification], comfirm: '是否要删除该条数据', method: :delete ,:class => 'btn'%>
						</div>
					</li>
					<% end %>
				</ul>
				<%= will_paginate @notifications, :previous_label =>'上一页', :next_label => '下一页' %>
			</div>
		
		</div>

		
	</div>
</div>
